package pl.edu.mimuw.irs.core.model.petrinet;

import pl.edu.mimuw.irs.core.global.IDManager;

/**
 * @author Jakub Rauch
 * Created on: 2009-05-07
 */
public abstract class Element implements IElement {

	private static final long serialVersionUID = 241655908565955213L;
	
	// *** Attributes

	// The whole net
	private Net net;
	private String id;
	private IDManager idManager;
	public Net getNet() {
		return net;
	}
	public void setNet(Net net) {
		this.net = net;
	}

	@Override
	public String getId() {
		if (id == null) id = idManager.getNewId();
		return id;
	}
	@Override
	public void setId(String id) {
		this.id = id;
	}
	@Override
	public IDManager getIdManager() {
		return idManager;
	}
	@Override
	public void setIdManager(IDManager idManager) {
		this.idManager = idManager;
	}
	
	// *** Methods
}
